A Selective CPS Transformation

نویسنده

  • Lasse R. Nielsen
چکیده

The CPS transformation makes all functions continuation-passing, uniformly. Not all functions, however, need continuations: they only do if their evaluation includes computational effects. In this paper we focus on control operations, in particular “call with current continuation” and “throw”. We characterize this involvement as a control effect and we present a selective CPS transformation that makes functions and expressions continuation-passing if they have a control effect, and that leaves the rest of the program in direct style. We formalize this selective CPS transformation with an operational semantics and a simulation theorem à la Plotkin.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Assessing the Overhead of ML Exceptions by Selective CPS Transformation

ML’s exception handling makes it possible to describe exceptional execution flows conveniently, but it also forms a performance bottleneck. Our goal is to reduce this overhead by source-level transformation. To this end, we transform source programs into continuation-passing style (CPS), replacing handle and raise expressions by continuationcatching and throwing expressions, respectively. CPS-t...

متن کامل

CPS transformation of beta-redexes

The extra compaction of the most compacting CPS transformation in existence, which is due to Sabry and Felleisen, is generally attributed to (1) making continuations occur first in CPS terms and (2) classifying more redexes as administrative. We show that this extra compaction is actually independent of the relative positions of values and continuations and furthermore that it is solely due to ...

متن کامل

CPS transformation of flow information , Part II : administrative reductions ∗ DANIEL

We characterize the impact of a linear β-reduction on the result of a control-flow analysis. (By ‘a linear β-reduction’ we mean the β-reduction of a linear λ-abstraction, i.e., of a λabstraction whose parameter occurs exactly once in its body.) As a corollary, we consider the administrative reductions of a Plotkin-style transformation into Continuation-Passing Style (CPS), and how they affect t...

متن کامل

A !rst-order one-pass CPS transformation

We present a new transformation of -terms into continuation-passing style (CPS). This transformation operates in one pass and is both compositional and !rst-order. Previous CPS transformations only enjoyed two out of the three properties of being !rst-order, one-pass, and compositional, but the new transformation enjoys all three properties. It is proved correct directly by structural induction...

متن کامل

A Simple Correctness Proof of the Direct-Style Transformation

We build on Danvy and Nielsen’s first-order program transformation into continuation-passing style (CPS) to present a new correctness proof of the converse transformation, i.e., a one-pass transformation from CPS back to direct style. Previously published proofs were based on CPS transformations that were either higher-order, noncompositional, or operating in two passes, and were correspondingl...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 45  شماره 

صفحات  -

تاریخ انتشار 2001